package comment;

import java.util.HashMap;
import java.util.Map;

/**
 *create by tbj
 */
public class single {
	private static single s=null;
	private single(){
	}
	public synchronized static single getInstance(){
		if(s == null){
			s = new single();
		}
		return s;
	}
}
/*public class single{
	private static final single s=new single();
	private single(){}
	public static single getInstance(){
		return s;
	}
}*/
/*public class Multiton{
	private static Map<String,Multiton> map=new HashMap<>();
	private Multiton(){}
	public static Multiton getInstance(String key){
		Multiton m=map.get(key); 
		if(m == null){
			map.put(key, m);
		}
		return m;
	}
}*/
